package org.dtrd.modules.flup.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.dtrd.modules.flup.entity.bean.FlupTemplateProjectRelationDetail;

import java.util.Date;


/**
 * <p>
 * 复诊模版和复诊模版内容关系表
 * </p>
 *
 * @author QR
 * @since 2021-12-21
 */
@Data
@NoArgsConstructor
@TableName("dtrd_rl_flup_template_project")
public class DtrdRlFlupTemplateProject {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 复诊模版id
     */
    @TableField("template_id")
    private Integer templateId;

    /**
     * 复诊模版项目id
     */
    @TableField("template_project_id")
    private Integer templateProjectId;

    @TableField("create_time")
    private Date createTime;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    public DtrdRlFlupTemplateProject(Integer templateId, Integer templateProjectId) {
        this.templateId = templateId;
        this.templateProjectId = templateProjectId;
    }

    public DtrdRlFlupTemplateProject init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdRlFlupTemplateProject parseFromDto(FlupTemplateProjectRelationDetail dto) {
        dataId = dto.getDataId();
        templateId = dto.getTemplateId();
        templateProjectId = dto.getTemplateProjectId();
        return this;
    }


}
